<?php

/**
 # com_jvframwork - JV Framework
 # @version		1.5.x
 # ------------------------------------------------------------------------
 # author    Open Source Code Solutions Co
 # copyright Copyright (C) 2011 joomlavi.com. All Rights Reserved.
 # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL or later.
 # Websites: http://www.joomlavi.com
 # Technical Support:  http://www.joomlavi.com/my-tickets.html
-------------------------------------------------------------------------*/
defined('_JEXEC') or die('Restricted access');

class Gfont {
    
    /**
     * Get array font from file 
     * 
     * @access public
     * @return array font
     */
    public function getFont() {
        $array_font = array();

        $font = JFile::read(dirname(__file__) . DS . 'font.json');
        
        return json_decode($font);                
    }
    
    /**
     *  Get font name from fontlist 
     * 
     * @param string $font
     * @access public
     * @return string font name.
     */
    public function getFontname($font) {
        $array = Gfont::getFont();
        if (count_chars($array[$font])) {
            return $array[$font];
        }
        return;
    }
    
    public function getFontSettup($path = ''){
        $fontsetup = JFile::exists($path . DS . 'fontsetup.ini') ?  JFile::read($path . DS . 'fontsetup.ini') : JFile::read(dirname(__file__) . DS . 'fontsetup.ini');
        $params    = new  JParameter($fontsetup, '');        
        return $params->toArray();
    }
}
